<?php
class site_k_staff extends ss_konstrukt_detail_component {
	protected $templates;
	protected $structureMapper;
	protected $entryMapper;
	protected $strucure;
	protected $node;
	protected $office;
	
	public function __construct($ss_settings,site_templatefactory $templates, site_dao_structure_mapper $structureMapper){
		$this->structureMapper=$structureMapper;
		$this->structure=$structureMapper->getFullActiveStructure();
    	$this->templates = $templates;
		$this->settings=$ss_settings;
	}
	
	public function dispatch(){
		$this->employee=$this->injector()->create('site_dao_staff_mapper')->employeeBySlug($this->name());
		//$this->offices= $this->injector()->create('site_dao_office_mapper')->officeByID();
		//$this->node=$this->structure->getNodeFromSlug($this->name());
		//$this->document->setTitle("Structure ".$this->node->headline());
		ss_error::log('Staff dispatch '.$this->name());
		//$this->entries=$this->entryMapper->getEntriesByCategorySlug($this->name());
		
		return parent::dispatch();
	}
	
	protected function renderHtml() {
		$content=$this->employee->getDetailData();
		ss_error::log($content,'Employee');
		ss_error::log('Index render');
    	$smarty = $this->templates->create();
	    $smarty->assign('content', $content);
		$smarty->register_object('ss_path', $this->settings->server->appath);
	    $smarty->assign('context', $this);
    	return $smarty->fetch("staff.tpl");
	}
}
?>